<template>
	<div>
    <div class="login-body">
  	 	<div class="login-form">
        <div class="login-photo">

        </div>
        <mu-avatar slot="left" :size="48" :iconSize="36" icon="perm_identity"/><br/>
  			<mu-text-field label="用户名" hintText="请输入账号" v-model="username" labelFloat/><br/>
  	  	<mu-text-field label="密码" hintText="请输入密码" v-model="password" type="password" labelFloat/><br/>
  	    <mu-raised-button label="登录" @click="login" fullWidth primary/>
  	    
      </div>
    </div>
	</div>
</template>
<script>

import * as types from './store/types'
export default {
 	name: '',
    data () {
      return {
        username:'',
        password:'',
        token: true
      }
    },
    mounted(){
    	
    },
    methods: {
      	login(){
      		let that = this
      		that.axios.post('/gleenSoft-base/login_login?username='+that.username).then(function (response) {
	        	that.$parent.isLogin=true
	          	that.$store.commit(types.LOGIN, that.token)
	          	let redirect = decodeURIComponent(that.$route.query.redirect || '/');
	          	that.$router.push({
	            	path: redirect
	          	})
	        })
      	}
    }
}
</script>
<style >
  .login-body{
    width:100%;
    height: 100%; 
    position: fixed;
    -moz-background-size:cover;
    -webkit-background-size:cover;
    -o-background-size:cover;
    background-size:cover;
    background: url(http://cas.spt518.com/gleenSoft-base/web/static/timg.jpg);

  }
  .login-form{
    width: 90%;
    position: absolute;
    padding: 30px 10px;
    left: calc(5%);
    top: calc(50% - 13em);
    border-radius: 5px;
    background: white;
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.26);
    overflow: hidden;
    text-align: center;
  }

</style>